//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.Resource.Properties;

namespace EntLibContrib.Resource.Configuration.Design
{
	/// <summary>
	/// Node map registrar for the Resource Application Block
	/// this registers tree nodes with the configuration console
	/// and is used by the node builder to create the appropriate
	/// node type from the data type
	/// </summary>
	public sealed class ResourceNodeMapRegistrar : NodeMapRegistrar
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="T:ResourceNodeMapRegistrar"/> class.
		/// </summary>
		/// <param name="serviceProvider">A mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		public ResourceNodeMapRegistrar (IServiceProvider serviceProvider) : base(serviceProvider)
		{
		}
		#endregion

		#region Public Methods
		/// <summary>
		/// Registers the node maps.
		/// </summary>
		public override void Register ()
		{
			AddMultipleNodeMap(InternalResources.CustomResourceManagerUICommandText,
												typeof(CustomResourceManagerNode),
												typeof(CustomResourceManagerData));

			AddMultipleNodeMap(InternalResources.ResourceManagerUICommandText,
												typeof(ResourceManagerNode),
												typeof(ResourceManagerData));

			AddSingleNodeMap(InternalResources.CustomResourceProviderUICommandText,
											typeof(CustomResourceProviderNode),
											typeof(CustomResourceProviderData));

			AddSingleNodeMap(InternalResources.AssemblyResourceProviderUICommandText,
											typeof(AssemblyResourceProviderNode),
											typeof(AssemblyResourceProviderData));

			AddSingleNodeMap(InternalResources.BinaryResourceProviderUICommandText,
											typeof(BinaryResourceProviderNode),
											typeof(BinaryResourceProviderData));

			AddSingleNodeMap(InternalResources.XmlResourceProviderUICommandText,
											typeof(XmlResourceProviderNode),
											typeof(XmlResourceProviderData));
		}
		#endregion
	}
}